package main

import "fmt"

type Goodss struct {
	Name   string
	Price  float64
	number int
}

func (g *Goodss) smallFunc() {

}

type Book1 struct {
	Goodss //嵌套匿名结构体Goodss
	Writer string
}

func main() {
	var b Book1 = Book1{ //继承初始化父类
		Goodss: Goodss{
			Name:   "TNT",
			Price:  1230,
			number: 1230,
		},
		Writer: "",
	}

	fmt.Println(b)
	fmt.Println(b.number)

}
